package com.lagou.biz.impl;


import java.util.List;

import com.lagou.biz.ManagerBiz;
import com.lagou.dao.ManagerDao;
import com.lagou.dao.impl.ManagerDaoImpl;
import com.lagou.entity.Business;
import com.lagou.entity.Company;
import com.lagou.entity.First;
import com.lagou.entity.Position;
import com.lagou.entity.Second;
import com.lagou.entity.Third;
import com.lagou.entity.UBasic;
import com.lagou.entity.User;


public class ManagerBizImpl implements ManagerBiz{
	ManagerDao dao=new ManagerDaoImpl();

	@Override
	public List<Company> queryByPage(int page, int size) {
int count=getCount();
		
		int pagecount=count%size==0?(count/size):(count/size+1);
		page=page<1?1:page;
		page=page>pagecount?pagecount:page;
		
		return dao.queryByPage(page, size);
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return dao.getCount();
	}

	@Override
	public int getPositionCount() {
		// TODO Auto-generated method stub
		return dao.getPositionCount();
	}

	@Override
	public List<Position> queryPositionByPage(int page, int size) {
int count=getPositionCount();
		
		int pagecount=count%size==0?(count/size):(count/size+1);
		page=page<1?1:page;
		page=page>pagecount?pagecount:page;
		
		return dao.queryPositionByPage(page, size);
	}

	@Override
	public List<Company> queryAll() {
		// TODO Auto-generated method stub
		return dao.queryAll();
	}

	@Override
	public int getUBCount() {
		
		// TODO Auto-generated method stub
		return dao.getUBCount();
	}

	@Override
	public List<UBasic> queryUBByPage(int page, int size) {
		int count=getUBCount();
		int pagecount=count%size==0?(count/size):(count/size+1);
		page=page<1?1:page;
		page=page>pagecount?pagecount:page;
		
		return dao.queryUBByPage(page, size);
	}

	@Override
	public List<Second> queryAllSecond() {
		// TODO Auto-generated method stub
		return dao.queryAllSecond();
	}

	@Override
	public List<Third> queryAllThird() {
		// TODO Auto-generated method stub
		return dao.queryAllThird();
	}

	@Override
	public boolean addf(First f) {
		// TODO Auto-generated method stub
		return dao.addf(f);
	}

	@Override
	public boolean adds(Second s) {
		// TODO Auto-generated method stub
		return dao.adds(s);
	}

	@Override
	public boolean addt(Third t) {
		// TODO Auto-generated method stub
		return dao.addt(t);
	}

	@Override
	public First queryByFName(String name) {
		// TODO Auto-generated method stub
		return dao.queryByFName(name);
	}

	@Override
	public List<Second> querySecondByFId(int id) {
		// TODO Auto-generated method stub
		return dao.querySecondByFId(id);
	}

	@Override
	public Second queryBySName(String name) {
		// TODO Auto-generated method stub
		return dao.queryBySName(name);
	}

	@Override
	public List<Third> querySecondByTId(int id) {
		// TODO Auto-generated method stub
		return dao.querySecondByTId(id);
	}

	@Override
	public boolean updateByBId(int st, int bid) {
		// TODO Auto-generated method stub
		
		return dao.updateByBId(st, bid);
	}

	@Override
	public boolean updateByPId(int pid, int st) {
		// TODO Auto-generated method stub
		return dao.updateByPId(st, pid);
	}

	@Override
	public boolean updateByUId(int uid, int st) {
		// TODO Auto-generated method stub
		return dao.updateByUId(st, uid);
	}

	@Override
	public List<Business> queryAllB() {
		// TODO Auto-generated method stub
		return dao.queryAllB();
	}

	@Override
	public boolean updateByCId(int bid, int st) {
		// TODO Auto-generated method stub
		return dao.updateByCId(st, bid);
	}

	@Override
	public List<User> queryAllU() {
		// TODO Auto-generated method stub
		return dao.queryAllU();
	}

	
	

}
